package com.lintf.web.controller.bot;

import com.lintf.bot.domain.dto.BotMoneyAddDTO;
import com.lintf.bot.domain.dto.BotMoneyListDTO;
import com.lintf.bot.domain.dto.BotMoneyUpdateDTO;
import com.lintf.bot.service.IBotMoneyService;
import com.lintf.common.core.controller.BaseController;
import com.lintf.common.core.domain.AjaxResult;
import com.lintf.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @ system:Mac
 * @ author:lin tingfeng
 * @ data:2024/1/9 10:07
 * @ package_name:com.lintf.web.controller.bot
 * @ project_name:mobile-project
 * @ desc:
 */
@RestController
@RequestMapping("/bot/money")
public class BotMoneyController extends BaseController {

    @Autowired
    private IBotMoneyService botMoneyService;

    @GetMapping("/list")
    public TableDataInfo list(BotMoneyListDTO dto) {
        return getDataTable(botMoneyService.list(dto));
    }

    @PostMapping("/add")
    public AjaxResult add(@RequestBody BotMoneyAddDTO dto) {
        botMoneyService.add(dto);
        return AjaxResult.success();

    }

    @PostMapping("/update")
    public AjaxResult update(@RequestBody BotMoneyUpdateDTO dto) {
        botMoneyService.update(dto);
        return AjaxResult.success();
    }

    @PostMapping("/remove")
    public AjaxResult remove(@RequestBody BotMoneyUpdateDTO dto) {
        botMoneyService.remove(dto);
        return AjaxResult.success();
    }
}
